package com.sixks.app.domain.sku;

/**
 * @author colin
 * @date: 15/03/2014
 * @time: 10:37
 */
public class ClothesSKU {

    private String attr;
    private int quantity;
    private int productId;
    private String image;

    private Order belongsTo;

    public Order getBelongsTo() {
        return belongsTo;
    }

    public void setBelongsTo(Order belongsTo) {
        this.belongsTo = belongsTo;
    }

    public String getAttr() {
        return attr;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public void setAttr(String attr) {
        this.attr = attr;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ClothesSKU)) return false;

        ClothesSKU that = (ClothesSKU) o;

        if (quantity != that.quantity) return false;
        if (!attr.equals(that.attr)) return false;
        if (!image.equals(that.image)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = attr.hashCode();
        result = 31 * result + quantity;
        result = 31 * result + image.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "ClothesSKU{" +
                "productId='" + productId + '\'' +
                ", attr=" + attr +
                '}';
    }
}
